{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "3b107f46",
   "metadata": {},
   "source": [
    "# 元组（tuple）\n",
    "> 1. 它是和list几乎一样的序列数据\n",
    "> 2. 它和list不同的地方是，**不可变**（因为不可变，所以几乎没有方法）\n",
    "> 3. 元组的形式：（1，2，321，31）对比元组（） 列表[]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "64f5104c",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "('2131', '2112', '2434') <class 'tuple'>\n"
     ]
    }
   ],
   "source": [
    "stu_id = \"2131\",\"2112\",\"2434\"\n",
    "print(stu_id,type(stu_id))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "d74cca1b",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "1"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stu_id.count(\"2131\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2d142f36",
   "metadata": {},
   "outputs": [],
   "source": [
    "stu_id."
   ]
  },
  {
   "cell_type": "markdown",
   "id": "bc2f74bf",
   "metadata": {},
   "source": [
    "# 字典（dict）\n",
    "> 1. 创建字典的三种常见的方法\n",
    ">> 1. 直接按照字典的格式创建 ： {key1：value1，key2：value2，...}\n",
    ">> 2. dict()函数来创建字典： dict（key1=value1，key2=value2，....）\n",
    ">> 3. 字典数据增加的方式：新建空字典 dict_name={},dict_name[key1]=value1..."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "42f1e4ce",
   "metadata": {},
   "outputs": [],
   "source": [
    "#01 \n",
    "stud_info = {\n",
    "    \"stud_2131\":\"joe\",\n",
    "    \"stud_2112\":\"jojo\",\n",
    "    \"stud_2434\":\"ethel\"\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "dc6138c2",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 02\n",
    "stud_info_02 = {\n",
    "    stud_2131=\"joe\",\n",
    "    stud_2112=\"jojo\",\n",
    "    stud_2434=\"ethel\"\n",
    "}"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3681a427",
   "metadata": {},
   "outputs": [],
   "source": [
    "#03\n",
    "info3 = {}\n",
    "info3[\"stu1801\"]=\"ZiQi\"info3[\"stu1802\"]=\"XiaoFeng\"\n",
    "info3[\"stu1803\"]=\"LiuYu\"\n",
    "print(info3)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
